package com.example.springboot.controller;

import com.example.springboot.service.BlogCorrectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/correct_num")
public class CorrectNumController {
    @Autowired
    BlogCorrectService blogCorrectService;
    @GetMapping
    public ResponseEntity<List<Map<String, Integer>>> getCorrectNum(@RequestParam Integer postId) {
        List<Map<String, Integer>> res =blogCorrectService.getCorrectNum(postId);
        return new ResponseEntity<>(res, HttpStatus.OK);
    }
}
